import React from 'react';
import style from './loading.module.scss';
import {render} from 'react-dom';

//loading 组件
function Loading(){
    return <div className={style['loading-wrap']}>
        <div className={style['loading-img']}></div>
    </div>
}

function createLoading(){
    let parentNode = document.createElement('div');
    document.body.appendChild(parentNode);
    render(<Loading/>,parentNode);
    return () => {
        document.body.removeChild(parentNode);
    }
}
export default createLoading
